home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / font3d10.zip / Config.H < prev    next >
C/C++ Source or Header  |  1994-09-15  |  5KB  |  95 lines

  1. //=================================================================================================
  2. //   Config.H
  3. //
  4. //   Copyright (c) 1994 by Todd A. Prater.
  5. //   All rights reserved.
  6. //
  7. //-------------------------------------------------------------------------------------------------
  8. //
  9. //   Type definitions and enumerations.  Hopefully, anything that is platform-specific can be put
  10. //   in here.
  11. //
  12. //=================================================================================================
  13.  
  14. #ifndef __Config_H__
  15. #define __Config_H__
  16.  
  17.    // ____ Data Types:                                                                         ____
  18.    // ____                                                                                     ____
  19.    // ____   BYTE......... An unsigned 8-bit integer data type.                                ____
  20.    // ____   CHAR......... A signed 8-bit integer data type.                                   ____
  21.    // ____   USHORT....... An unsigned 16-bit integer data type.                               ____
  22.    // ____   SHORT........ A signed 16-bit integer data type.                                  ____
  23.    // ____   ULONG........ An unsigned 32-bit integer data type.                               ____
  24.    // ____   LONG......... A signed 32-bit integer data type.                                  ____
  25.    // ____   DOUBLE....... A double precision floating point data type.                        ____
  26.  
  27.    #ifdef __MSDOS__
  28.  
  29.       typedef unsigned char         BYTE;       // Unsigned  8-bit integer data type
  30.       typedef char                  CHAR;       // Signed    8-bit integer data type
  31.       typedef unsigned short int    USHORT;     // Unsigned 16-bit integer data type
  32.       typedef signed short int      SHORT;      // Signed   16-bit integer data type
  33.       typedef unsigned long int     ULONG;      // Unsigned 32-bit integer data type
  34.       typedef signed long int       LONG;       // Signed   32-bit integer data type
  35.       typedef double                DOUBLE;     // Double precision floating point.
  36.  
  37.    #else
  38.  
  39.       typedef unsigned char         BYTE;
  40.       typedef signed char           CHAR;
  41.       typedef unsigned short int    USHORT;
  42.       typedef signed short int      SHORT;
  43.       typedef unsigned long int     ULONG;
  44.       typedef signed long int       LONG;
  45.       typedef double                DOUBLE;
  46.  
  47.    #endif
  48.  
  49.    typedef BYTE                 *BYTEPTR;
  50.    typedef CHAR                 *CHARPTR;
  51.    typedef USHORT               *USHORTPTR;
  52.    typedef SHORT                *SHORTPTR;
  53.    typedef ULONG                *ULONGPTR;
  54.    typedef LONG                 *LONGPTR;
  55.    typedef DOUBLE               *DOUBLEPTR;
  56.    typedef LONG                  INT;
  57.    typedef USHORT                uFWord;
  58.    typedef SHORT                 FWord;
  59.    typedef ULONG                 Fixed;
  60.    typedef USHORT                F2Dot14;
  61.  
  62.    enum  BOOLEAN           { FALSE, TRUE };
  63.    enum  POINTTYPE         { NO_POINT, OFF_CURVE, ON_CURVE };
  64.    enum  CONTOURTYPE       { IGNORE, OUTSIDE, INSIDE };
  65.    enum  ORIENTATIONTYPE   { CLOCKWISE, COUNTER_CLOCKWISE };
  66.    enum  EFFECTSTYPE       { NONE, BEVEL, ROUND };
  67.    enum  FORMATTYPE        { POV_FLAT, POV_SMOOTH, RAW };
  68.  
  69.    // ____ Conversion Macros:                                                                  ____
  70.    // ____                                                                                     ____
  71.    // ____    toDOUBLE(x)...........Converts a 'Fixed' data object to a DOUBLE                 ____                        
  72.    // ____    toUSHORT(b1,b2).......Combines two bytes 'b1' and 'b2' ('b1' is MSB) into a      ____
  73.    // ____                          'USHORT' data object.                                      ____
  74.    // ____    toSHORT (b1,b2).......Combines two bytes 'b1' and 'b2' ('b1' is MSB) into a      ____
  75.    // ____                          'SHORT' data object.                                       ____
  76.    // ____    toULONG (b1,b2,b3,b4).Combines four bytes 'b1', 'b2', 'b3', and 'b4' ('b1' is    ____
  77.    // ____                          MSB, 'b4' is LSB) into a 'ULONG' data object.              ____
  78.  
  79.    #define toDOUBLE(x)           (  (((SHORT)(x>>16))>0)\
  80.                                   ? ( ((SHORT)(x>>16))\
  81.                                      +(((DOUBLE)(0x0000ffff&x))/(0xffffffff)))\
  82.                                   : ( ((SHORT)(x>>16))\
  83.                                      -(((DOUBLE)(0x0000ffff&x))/(0xffffffff))))
  84.  
  85.    #define toUSHORT(b1,b2)       (((USHORT)b1<<8)+((USHORT)b2))
  86.    #define toSHORT(b1,b2)        ((SHORT)((USHORT)b1<<8)+((USHORT)b2))
  87.    #define toULONG(b1,b2,b3,b4)  (((ULONG)b1<<24)+((ULONG)b2<<16)+((ULONG)b3<<8)+((ULONG)b4))
  88.  
  89.    // ____ A Macro that evaluates to 1 if a bit position is set in a byte, 0 otherwise.       ____ 
  90.  
  91.    #define isBitSet(byte,bit)    ((0x01<<bit)&byte)
  92.  
  93. #endif
  94.  
  95.